package com.iamteer.e_locale;

import java.util.Locale;

import org.junit.Test;

public class App {
	// 1. 本地化对象：Locale
	// 封装语言、国家信息的对象，由 java.util 提供
	@Test
	public void testLocale() throws Exception {
		// 模拟中国语言环境
//		Locale locale = Locale.CHINA;
		Locale locale = Locale.getDefault();
		System.out.println(locale.getCountry());
		System.out.println(locale.getDisplayCountry());
		System.out.println(locale.getLanguage());
		
		// 模拟美国语言环境
		Locale us = Locale.US;
		System.out.println(us.getCountry());
		System.out.println(us.getDisplayCountry());
	}
}
